#define _STR_MODULE_

#include "osObjects.h"
#include "strctr.h"
#include "gd25q_cmd.h"
#include "pincfg.h"

uint8_t Gd25DataBuff[1024];

/*****************************************************************************//*!
*
* @brief   led task.
*     
* @param   none
*
* @return  none
*
* @ Pass/ Fail criteria: none
*****************************************************************************/

void StrCtrTask(void *argument) {
    uint16_t Cnt;
  
    gdSpiInit();
    Cnt = 0;
    
    for (;;) {
        
        SPI_SDCS = 0;
        vTaskDelay(5000);
        SPI_SDCS = 1;
        
        xSemaphoreTake(xMutexStr,0);
        gd25qRead(Cnt, 1024, Gd25DataBuff);
        xSemaphoreGive(xMutexStr);
        
        Cnt++;
        if(Gd25DataBuff[0]){
           // Cnt = 256;
            //while(Cnt--)
            //  Gd25DataBuff[Cnt] = Cnt;
            //gd25qWrite(0x00, 256, Gd25DataBuff);
            //gd25qWrite(0x100, 256, Gd25DataBuff);
            //gd25qWrite(0x200, 256, Gd25DataBuff);
            //gd25qWrite(0x300, 256, Gd25DataBuff);
            //gd25qWrite(0x400, 256, Gd25DataBuff);
            //gd25qWrite(0x500, 256, Gd25DataBuff);
        }
    }
}
